<?php


namespace App\Controller;

use App\Request\GetCodeForSignUpRequest;
use App\Service\MailService;
use Hyperf\Di\Annotation\Inject;

/**
 * Class MailController
 * @package App\Controller
 */
class MailController extends AbstractController
{

    /**
     * @var MailService
     */
    #[Inject]
    protected MailService $mailService;

    /**
     * 获取邮箱验证码
     */
    public function getCode(GetCodeForSignUpRequest $getCodeForSignUpRequest)
    {
        $email = $this->request->input('email');
        $this->mailService->getCode($email);
        return $this->response->success();
    }
}